<template>
	<view class="cc">
		<u-row justify="space-between" gutter="20">
			<u-col span="3">
				<text class="title">{{tname}}</text>
			</u-col>
			<u-col span="4">
				<uni-number-box class="num" @change="click1" v-model="value3" :min="0" :max="100"></uni-number-box>
			</u-col>
			<u-col span="0.5">
				<text class="title">--</text>
			</u-col>
			<u-col span="4">
				<uni-number-box class="num" @change="click2" v-model="value4" :min="0" :max="100"></uni-number-box>
			</u-col>
		</u-row>
	</view>
</template>

<script>
	export default {
		name: "temp_picker",
		data() {
			return {
				show1: false,
				show2: false,
				value3: '',
				value4: ''
			};
		},
		props: {
			//从父控件传过来的值
			tname: {
				type: String,
				default: ''
			},
			value1: {
				type: Number,
				default: 35
			},
			value2: {
				type: Number,
				default: 30
			},
		},
		onLoad() {
			this.value3 = this.value1
			this.value4 = this.value2
			console.log('load:'+tname+'--'+value1+'--'+value2)
		},
		onShow() {
			console.log('onShow:'+tname+'--'+value1+'--'+value2)
		},
		methods: {
			click1(e) {
				console.log('1111111111111:' + e)
				this.$emit('changeValue1', e)
			},
			click2(e) {
				console.log('222222:' + e)
				this.$emit('changeValue2', e)
			},

		}
	}
</script>

<style>
	.title {
		height: 50rpx;
		position: absolute;
		transform: translate(0, -50%);
	}

	.cc {
		margin-top: 32rpx;
		height: 100rpx;
		width: 100vw;
	}
</style>